package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	students := []string{"徐子轩", "龙逸", "何浩田", "陈丽标", "肖威", "史伟名", "易鸽玲"}
	fmt.Println("按任意键抽取，按q退出")
	for {
		var button string
		fmt.Scan(&button)
		if button == "q" || len(students) == 0 {
			break
		} else {
			randResource := rand.NewSource(time.Now().UnixNano())
			randomnumber := rand.New(randResource).Intn(len(students))
			fmt.Printf("抽到的同学是%v", students[randomnumber])
			students = append(students[:randomnumber], students[randomnumber+1:]...)
		}
	}
}

